<template>
	<view>

		<view  style="width: 700rpx;margin:40rpx auto;">
			<view  v-for="(item,index) in list" :key="index">
				
					<view class="u-font-weight u-font-34 u-margin-top-40">{{item.name}}</view>
					<view class="u-flex u-row-between u-flex-wrap">
						<view class="block" v-for="(item1,index1) in item.paper " :key="index1" @click="go(item1)">
							<image src="/static/paper.png" style="width: 48rpx;height: 48rpx;"></image>
							<view style="width: 200rpx;text-align: left;margin-left: 10rpx;">{{item1.name}}</view>
						</view>
					</view>
				
				</view>
			</view>
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				subject: "",
				vip: '',
				car_type: "",
				type:''
			}
		},
		onLoad(options) {
			if (options.subject) {
				this.subject = options.subject
			}
			if (options.vip) {
				this.vip = options.vip
			}
			if (options.car_type) {
				this.car_type = options.car_type
			}
			if(options.type){
				uni.setNavigationBarTitle({
					title:options.type
				})
				this.type=options.type;
			}
			this.jiazai()
		},
		methods: {
			jiazai() {
				this.$u.post('/index/cate', {
					subject: this.subject,
					vip: this.vip,
					car_type: this.car_type,
				}).then(res => {
					this.list = res;
				}).catch(err => {

				})
			},
			go(item){
				uni.navigateTo({
					url:'/pages/case/index?cate_id='+item.id+'&type='+this.type
				})
			}
		}
	}
</script>

<style scoped>
	.block{
		padding: 15rpx;
		border-radius: 10rpx;
		width: 49%;
		text-align: center;
		background: #F1F1F1;
		display: flex;
		align-items: center;
		color: #414141;
		justify-content: space-between;
		margin-top: 20rpx;
		padding-left: 80rpx;
	}
</style>
